package com.homedo.microservice.open.service.gateway.alert.bean.enums;

/**
 * 逻辑删除字段
 */
public enum MarkEnum {

    NO_DELETE((short) 1, "未删除"),
    DELETE((short) 0, "删除"),
    /**
     * 查询补充字段，-1代表查询全部
     */
    _SELECT_ALL((short) -1, "查询全部");

    private short code;
    private String desc;

    private MarkEnum(short code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public short getCode() {
        return code;
    }

    public void setCode(short code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static MarkEnum getMarkEnumByCode(short code) {
        for (MarkEnum innerEnum : MarkEnum.values()) {
            if (innerEnum.getCode() == code) {
                return innerEnum;
            }
        }
        return null;
    }
}
